package com.zjh.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Response<T> {

    private ResponseCode responseCode;
    private String msg;
    private T obj;

    public static Response success(String msg)
    {
        return new Response(ResponseCode.SUCCESS, msg, null);
    }

    public static <T> Response<T> success(T obj) {
        return new Response<>( ResponseCode.SUCCESS, "Operation successful", obj);
    }

    public static  Response success() {
        return new Response<>( ResponseCode.SUCCESS, "Operation successful", null);
    }
}
